import 'package:flutter/material.dart';
import 'package:xbxxz_assistant/data/newcomer_book_data.dart';
import 'package:xbxxz_assistant/strategy/land_page.dart';
import 'package:xbxxz_assistant/strategy/strategy_container_page.dart';

class StrategyPage extends StatefulWidget {
  @override
  _StrategyPageState createState() => _StrategyPageState();
}

class _StrategyPageState extends State<StrategyPage>
    with AutomaticKeepAliveClientMixin {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        color: Color.fromRGBO(220, 200, 160, 1.0),
        child: Column(
          children: <Widget>[
            Expanded(
              child: DefaultTabController(
                length: 11,
                child: Column(
                  children: <Widget>[
                    TabBar(
                      isScrollable: true,
                      unselectedLabelColor: Colors.black54,
                      labelColor: Colors.black87,
                      indicatorColor: Colors.black87,
                      tabs: <Widget>[
                        Tab(text: "地上"),
                        Tab(text: "天界攻略"),
                        Tab(text: "萌新手册"),
                        Tab(text: "人界攻略"),
                        Tab(text: "修真百科"),
                        Tab(text: "游戏知识"),
                        Tab(text: "功法"),
                        Tab(text: "丹方"),
                        Tab(text: "炼器"),
                        Tab(text: "丹药"),
                        Tab(text: "材料"),
                      ],
                    ),
                    Expanded(
                      child: Container(
                        child: TabBarView(
                          children: <Widget>[
                            LandPage(),
                            StrategyContainerPage(data: newComerBookData),
                            Center(child: Text("待完善")),
                            Center(child: Text("待完善")),
                            Center(child: Text("待完善")),
                            Center(child: Text("待完善")),
                            Center(child: Text("待完善")),
                            Center(child: Text("待完善")),
                            Center(child: Text("待完善")),
                            Center(child: Text("待完善")),
                            Center(child: Text("待完善")),
                          ],
                        ),
                      ),
                    ),
                  ],
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }

  @override
  bool get wantKeepAlive => true;
}
